<!DOCTYPE html>
<html>
<head>
    <meta name="Generator" content="ECSHOP v2.7.3"/>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <title>我的收藏</title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <meta name="Keywords" content=""/>
    <meta name="Description" content=""/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" type="text/css" href="/template/default/css/public.css"/>
    <link rel="stylesheet"  href="/template/default/css/flow.css">
    <link rel="stylesheet" type="text/css" href="/template/default/css/user.css"/>
</head>
<body class="bg-gary">
<div class="tab_nav">
    <div class="header">
        <div class="h-left">
            <a class="sb-back" href="javascript:history.back(-1)" title="返回"><img src="/template/default/images/arrow_left_white.png"/></a>
        </div>
        <div class="h-mid">收藏列表</div>
    </div>
</div>
<%if(favoriteProducts.~size>=1){%>
    <section>
        <ul class="listPage_ul">
            <%for(list in favoriteProducts){%>
                <li >
                    <a href="/b/product/detailWap?id=${list.productId}&shopId=${list.shopId!}">
                        <div class="pic_box">
                            <img src="${list.productImageList[0].sourceProductImagePath}">
                        </div>
                    </a>
                    <div class="figureText">
                        <a href="/b/product/detailWap?id=${list.productId}&shopId=${list.shopId!}" target="_self">
                            <em><b>${list.name!}</b></em>
                            <label><i>￥</i>${list.price!}<span class="OldPrice"></span></label>
                        </a>
                    </div>
                    <i class="delete_button"></i>
                    <input type="hidden" class="productId" value="${list.productId!}">
                </li>
            <%}%>

        </ul>
    </section>
<%}else{%>
    <section id="cart-content">
        <div class="qb_tac" style="padding:50px 0">
            <!--<img src="/template/default/images/empty_cart.png" width="100" height="95">-->
            <br>暂无收藏</div>
        <div class="qb_gap" style="width:60%; margin:0 auto;">
            <a href="/wap.html" class="mod_btn btn_strong" >去首页逛逛</a>
        </div>
    </section>
<%}%>
</body>
<script type="text/javascript" src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="https://static.9hive.cn/global/vendor/layer/layer.js"></script>
<script>
   $(".delete_button").click(function () {
       $this = $(this);
       var productId=$this.next().val();
       $.ajax({
           url: "/b/favorite/deleteFavorite",
           type: 'GET',
           data:{
               "productId": productId
           },
           success: function(data){
               if (data.state == 'ok'){
                   $this.parent().remove();
                   layer.msg("删除成功!");
               }else{
                   layer.msg(data.info);
               }
           }});

    });


</script>
</html>